home *** CD-ROM | disk | FTP | other *** search
/ BMUG PD-ROM A / PD-ROM A.iso / Education / Math / LOC(Metric) / LOCDoc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-11-20  |  1.4 KB  |  57 lines  |  [TEXT/KAHL]

  1. /* LOCDoc.c -- document methods */
  2. /* Created 10/4/91 10:31 AM by AppMaker */
  3.  
  4. /*    This module overrides the AppMaker-generated code in zLOCDoc.            */
  5. /*    It provides a place for you to add your own code and still be able to    */
  6. /*    generate code for new changes to the user interface.  This module will    */
  7. /*    not be regenerated by AppMaker unless you delete it.  Its superclass,    */
  8. /*    zLOCDoc, may be regenerated to handle user interface changes            */
  9. /*    without losing your hand-coded changes to this module.                    */
  10.  
  11. #include <CApplication.h>
  12. #include <CDataFile.h>
  13. #include "ResourceDefs.h"
  14. #include "LOCApp.h"
  15. #include "LOCDoc.h"
  16. #include "commands.h"
  17.  
  18. extern    CApplication    *gApplication;    /* The application */
  19.  
  20. /*----------*/
  21. Boolean    CLOCDoc::ReadData        (Handle        *theData)
  22. {
  23.     gApplication->RequestMemory (FALSE, FALSE);
  24.     ((CDataFile *)itsFile)->ReadAll (theData);
  25.     if (*theData == NULL) {
  26.         /*    Acknowledge (couldntReadID);    */
  27.         return (FALSE);
  28.     } else {
  29.         return (TRUE);
  30.     }
  31. }
  32.  
  33. /*----------*/
  34. void    CLOCDoc::WriteData    (void)
  35. {
  36.     /* application-specific write data to itsFile */
  37. }
  38.  
  39. /*----------*/
  40. void CLOCDoc::DoCommand (long        theCommand)
  41. {
  42.     switch (theCommand) {
  43.         default:
  44.                 inherited::DoCommand (theCommand);
  45.             break;
  46.     } /* switch */
  47.  
  48. }
  49.  
  50. /*----------*/
  51. void CLOCDoc::CloseWind ( CWindow *theWindow )
  52. {
  53.   CLOCApp *supervisor = (CLOCApp *) itsSupervisor;
  54.   inherited::CloseWind ( theWindow );
  55.   supervisor->DoCommand ( cmdQuit );
  56. }
  57.